/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2022-06-11
 * Time: 10:16
 */
class   Rabbit{
    //定义成员变量
    public     String  name;
    public     String  gender;
    public     String  color;
    public     int   weight;
    public     int   age;
    public   boolean flag;



    //定义成员方法
    public void   swag(){
        System.out.println(name+"摇尾巴");

    }
    public void  eat(){
        System.out.println(name+"吃青草");
    }
    public void show(){
        System.out.println("姓名"+name+"年龄"+age+"性别"+gender);
    }
}



public class TestDemo {
    public static void main(String[] args) {
        Rabbit rabbit=new Rabbit();
       /* Rabbit rabbit2=new Rabbit();
        Rabbit rabbit3=new Rabbit();
        rabbit1.gender;*/
        System.out.println(rabbit.name);
        System.out.println(rabbit.age);
        System.out.println(rabbit.color);
        System.out.println(rabbit.flag);
        System.out.println("===============");





        //对成员变量赋值
        rabbit.name="小白";
        rabbit.gender="雄性";
        rabbit.color="白色";
        rabbit.show();
        rabbit.eat();
        rabbit.swag();
       /* rabbit1.age="2岁";
        rabbit2.name="小白";
        rabbit2.gender="雄性";
        rabbit2.color="白色";
        rabbit2.age="2岁";
        rabbit3.name="小白";
        rabbit3.gender="雄性";
        rabbit3.color="白色";
        rabbit3.age="2岁";
*/


    }

}
